<?php

/**
 * LigneReglementFournisseur filter form base class.
 *
 * @package    SdCommerce
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseLigneReglementFournisseurFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'numero_piece'           => new sfWidgetFormFilterInput(),
      'numero_piece_du_cheque' => new sfWidgetFormFilterInput(),
      'montant'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'date'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'date_prise_en_charge'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'date_echeance'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'verser'                 => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'valide'                 => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'etat'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'reglement_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ReglementFournisseur'), 'add_empty' => true)),
      'id_mode_reglement'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'add_empty' => true)),
      'id_organisme'           => new sfWidgetFormFilterInput(),
      'id_caisse'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Caisse'), 'add_empty' => true)),
      'id_compte_bancaire'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CompteBancaire'), 'add_empty' => true)),
      'id_retenue_source'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('RetenueSource'), 'add_empty' => true)),
      'journal_caisse'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'facture_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureFournisseur'), 'add_empty' => true)),
      'bon_livraison_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'add_empty' => true)),
      'facture_avoir_id'       => new sfWidgetFormFilterInput(),
      'bl_retour_id'           => new sfWidgetFormFilterInput(),
      'created_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'deleted_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'numero_piece'           => new sfValidatorPass(array('required' => false)),
      'numero_piece_du_cheque' => new sfValidatorPass(array('required' => false)),
      'montant'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'date'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'date_prise_en_charge'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'date_echeance'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'verser'                 => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'valide'                 => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'etat'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'reglement_id'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ReglementFournisseur'), 'column' => 'id')),
      'id_mode_reglement'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ModeReglement'), 'column' => 'id')),
      'id_organisme'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'id_caisse'              => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Caisse'), 'column' => 'id')),
      'id_compte_bancaire'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('CompteBancaire'), 'column' => 'id')),
      'id_retenue_source'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('RetenueSource'), 'column' => 'id')),
      'journal_caisse'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'facture_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('FactureFournisseur'), 'column' => 'id')),
      'bon_livraison_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'column' => 'id')),
      'facture_avoir_id'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'bl_retour_id'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'deleted_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('ligne_reglement_fournisseur_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneReglementFournisseur';
  }

  public function getFields()
  {
    return array(
      'id'                     => 'Number',
      'numero_piece'           => 'Text',
      'numero_piece_du_cheque' => 'Text',
      'montant'                => 'Number',
      'date'                   => 'Date',
      'date_prise_en_charge'   => 'Date',
      'date_echeance'          => 'Date',
      'verser'                 => 'Boolean',
      'valide'                 => 'Boolean',
      'etat'                   => 'Boolean',
      'reglement_id'           => 'ForeignKey',
      'id_mode_reglement'      => 'ForeignKey',
      'id_organisme'           => 'Number',
      'id_caisse'              => 'ForeignKey',
      'id_compte_bancaire'     => 'ForeignKey',
      'id_retenue_source'      => 'ForeignKey',
      'journal_caisse'         => 'Boolean',
      'facture_id'             => 'ForeignKey',
      'bon_livraison_id'       => 'ForeignKey',
      'facture_avoir_id'       => 'Number',
      'bl_retour_id'           => 'Number',
      'created_at'             => 'Date',
      'updated_at'             => 'Date',
      'deleted_at'             => 'Date',
    );
  }
}
